
npx run dev

your_branch="master"
my_branch=$(git rev-parse --abbrev-ref HEAD)
echo $my_branch
if [ $my_branch == $your_branch ]
then
	echo "current branch: $my_branch"
else
	git fetch --depth=1
	git checkout $your_branch
fi

message="$(git log -1 --pretty=%B)"

git pull --tag origin $your_branch


last_commit=$(cat commit.txt)
echo "Last Commit $last_commit"
diff_ls=$(git diff $last_commit --name-only)
result=$(echo $diff_ls | grep "laya/")
if [[ "$result" != "" ]]
then
	echo "打包资源"
	layacmd ui -a -d -c
else
	echo "不打包资源"
fi

commit=$(git rev-parse --short HEAD)
echo $commit > commit.txt

npm run res

cd ../laya-rx
echo "$(git rev-parse --short HEAD)"

git add .
git commit -m "publish: commit:$commit, message:$message"
git push

read -n 1